<template>
	<view>
		<u-navbar title="待到账积分明细" :autoBack="true" :placeholder="true" leftIconColor="#ffffff" :titleStyle="{color: '#ffffff'}" bgColor="#e60000" class="navBarHeight">
		</u-navbar>
		<view class="padding-sm border-bottom" v-for="(item, index) in releasedList" :key="index">
			<view class="flex justify-between font-14 text-bold">
				<view>{{item.awardName}}</view>
				<view class="text-theme">￥{{item.awardAmount}}</view>
			</view>
			<view class="padding-top-xs word-break text-gray">到账钱包：<text v-for="(cItem, cIndex) in walletTypeList" :key="cIndex" v-if="item.walletId == cItem.value">{{cItem.label}}</text></view>
			<view class="padding-top-xs text-gray">到账时间：{{item.awardTime}}</view>
		</view>
		<u-loadmore :status="status" class="padding-bottom" />
	</view>
</template>

<script>
	import {
		findBuyReleasedList
	} from '@/common/api/customer.js'
	import {
		walletTypeList
	} from '@/common/api/dict.js'
	export default {
		data() {
			return {
				title: '',
				pageNo: 0,
				releasedList: [],
				status: 'loading',
				walletType: '',
				walletTypeList: walletTypeList,
			};
		},
		onLoad(options) {
			this.walletType = options.walletType
		},
		onShow() {
			this.pageNo = 0
			this.releasedList = []
			this.getFindBuyReleasedList()
		},
		// onReachBottom() {
		// 	this.getwalletFlow()
		// },
		methods: {
			getFindBuyReleasedList() {
				this.pageNo++
				this.status = 'loading'
				findBuyReleasedList({walletIds:this.walletType}).then(res => {
					this.releasedList = this.releasedList.concat(res.data)
					if (res.data.length < 10) {
						this.status = 'nomore'
					}
				})
			}
		}
	}
</script>

<style lang="scss">

</style>
